package org.umlviewer.xmiexporter;

import org.jdom2.Element;
import org.jdom2.Namespace;
import org.umlviewer.model.Constants;
import org.umlviewer.model.Relationship;

/**
 *
 * @author Rafa
 */
public class RealizationExporter extends RelationExporter{

    public RealizationExporter(Relationship r, int type){
        super(r, type);
    }

    @Override
    public Element xmiSerialize() {
        Namespace xmins = Constants.XMINAMESPACE;
        Element asos = new Element("ownedElement");        
        asos.setAttribute("type","uml:Realization",xmins);
        asos.setAttribute("id",getId(),xmins);
        asos.setAttribute("name",getRel().getLabel());
        asos.setAttribute("visibility","public");
        asos.setAttribute("supplier",getRel().getDestination().getId());
        asos.setAttribute("realizingClassifier",getRel().getDestination().getId()); //revisar este atributo
        asos.setAttribute("client",getRel().getSource().getId());
        return asos;
    }
    
    
}
